<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f1(){
            var s="dfhas345kdljfhkahK345DHKhkf3245hdsakfhkashdfklah231kSJhjkhk325jhkhdfhhi134hkjKHKDHSF1234KJDSFDsd";

            console.log(s.length);
            console.log(s.charAt(3));
            console.log(s.substring(3,5));

            console.log(s.startsWith("dfh"));
            console.log(s.endsWith("FDsd"))

            console.log(s.indexOf("a"));
            console.log(s.lastIndexOf("a"));

            console.log(s.toUpperCase());
            console.log(s.toLowerCase());

            console.log("   aaa bbb   ".trim());
            console.log("   aaa bbb   ".trimStart());
            console.log("   aaa bbb   ".trimEnd());

            console.log(s.replace(/d/,'X'));

            console.log(s.replace(/\d/,'X'));

            console.log(s.replace(/d/g,'X'));

            console.log(s.replace(/\d/g,'X'));

            console.log(s.replace(/d/gi,'X'));

            var s2="15978958786,15122235878";

            console.log(s2.replace(/(\d{3})(\d{5})(\d{3})/g,"$1*****$3"));

            console.log(s.match(/\d+/g));

            console.log(s.search(/\d+/));

            console.log(s2.split(","));
        }

        function f2(){
            var str="025-12345678";
            var reg=/^\d{3,4}-\d{8}$/;

            console.log(reg.test(str))
        }
    </script>
</head>
<body>
    <a href="javascript:;" onclick="f1();">test1</a>
    <a href="javascript:;" onclick="f2();">test2</a>
</body>
</html>